from django.core.management.base import BaseCommand, CommandError
from apps.order.models import *
from apps.message.models import *
from apps.product.models import *
from apps.repo.models import *
from datetime import timedelta
import time
from django.db import transaction
import sys
import time


class Command(BaseCommand):

    def add_arguments(self, parser):
        parser.add_argument('order_id', type=str)

    def handle(self, *args, **options):
        mobile = options.get('mobile')
        user = User.objects.get(mobile=mobile)

        gbs = GoodsBlock.objects.filter(owner_user_id=user.id, taken_out=True, trade_type=GoodsBlock.TradeType.TAKE_OUT.name)